revdeck 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,25 @@ All notable changes to this project are documented here. The format is based on
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.0] - 2026-11-12
10
+
11
+ ### Added
12
+
13
+ - Private **Note for the agent** on every finding; it is included in the CLI/MCP context and never
14
+ published.
15
+ - Reactions on the MR/PR itself (description) in the UI, HTTP API and RPC, in addition to thread-note
16
+ reactions. The current GitLab/GitHub user is stored with the review.
17
+ - Edit and delete own platform comments from the thread card; local line comments can also be edited and
18
+ deleted before publishing.
19
+ - Devcontainer MCP: `revdeck devcontainer --write` adds the `REVDECK_*` env to the `revdeck` server in
20
+ `.mcp.json` / `.cursor/mcp.json`, and a client in a devcontainer falls back to HTTP via the mounted
21
+ `daemon.json` when the Unix socket is unavailable.
22
+
23
+ ### Fixed
24
+
25
+ - The sidebar is ordered by the MR/PR update time, not by local sync time, so opening a review no longer
26
+ reorders the list. Switching reviews keeps the active tab.
27
+
9
28
  ## [0.3.3] - 2026-11-12
10
29
 
11
30
  ### Fixed
package/README.md CHANGED
@@ -149,6 +149,12 @@ Comment editors have GitLab/GitHub-style **Write / Preview** tabs and a Markdown
149
149
  videos from the platform host (including GitLab `/uploads/...` links and `{width=... height=...}`)
150
150
  render in the preview and in thread comments; external images are shown as links and are never loaded.
151
151
 
152
+ ## Notes for the agent
153
+
154
+ Every finding has a private **Note for the agent** field, and every thread has the same note next to the
155
+ reply. The text is included in `revdeck_context` / MCP but never published to GitLab or GitHub. Findings
156
+ also keep their decision note separately.
157
+
152
158
  ## Devcontainer
153
159
 
154
160
  The daemon, `glab` and `gh` stay on the host. From the repository root:
@@ -168,8 +174,13 @@ foreign keys in an existing JSONC file are preserved.
168
174
  The daemon creates the bridge socket on startup, so on the host run `revdeck daemon restart`, then
169
175
  rebuild the container. Inside the container revdeck never starts a local daemon, so `gh`/`glab` are
170
176
  never invoked there; if the host socket is missing it fails with a clear `DEVCONTAINER` error.
171
- `revdeck doctor` is aware of this mode. For the UI from the container, start the host daemon with
172
- `revdeck daemon start --host 0.0.0.0`.
177
+ `revdeck doctor` is aware of this mode.
178
+
179
+ If a Unix socket cannot be mounted (for example Docker Desktop on macOS), start the host daemon with
180
+ `revdeck daemon start --host 0.0.0.0`. The container reads `daemon.json` from the mounted state and
181
+ falls back to HTTP with the same session token; `.mcp.json` / `.cursor/mcp.json` get the required
182
+ `REVDECK_*` env from `revdeck devcontainer --write`. Binding the daemon to `0.0.0.0` exposes its HTTP
183
+ port to the network, so use it only on a trusted network.
173
184
 
174
185
  ## MCP
175
186
 
@@ -280,8 +291,8 @@ Provider tests use recorded CLI responses and need no network. See [CONTRIBUTING
280
291
  - Project checks are planned by the agent; running them requires `revdeck checks --run --yes`.
281
292
  - The UI opens a review from the **Open review** dialog; the working-copy root is required so the daemon
282
293
  can read `.revdeck.yml`.
283
- - Thread resolution is in the thread card; reactions are available on thread notes in the UI and through
284
- `revdeck react`.
294
+ - Thread resolution is in the thread card; reactions are available on thread notes and on the MR/PR
295
+ description. Own platform comments can be edited or deleted from the thread card.
285
296
  - GitHub has no public attachment API: the Attach button is disabled there; uploads work in GitLab.
286
297
  - Auto-start is supported on Linux and macOS; on Windows run the daemon manually.
287
298
 
package/README.ru.md CHANGED
@@ -135,6 +135,12 @@ API загрузки вложений, поэтому кнопка там отк
135
135
  отображаются в предпросмотре и в комментариях тредов; внешние картинки показываются ссылкой и не
136
136
  загружаются.
137
137
 
138
+ ## Заметки агенту
139
+
140
+ У каждого замечания есть приватное поле **Заметка агенту**, у каждого треда — такая же заметка рядом с
141
+ ответом. Текст попадает в `revdeck_context` / MCP, но никогда не публикуется в GitLab или GitHub.
142
+ Решение по замечанию хранится отдельно.
143
+
138
144
  ## Devcontainer
139
145
 
140
146
  Демон, `glab` и `gh` остаются на хосте. Из корня репозитория:
@@ -154,8 +160,13 @@ revdeck devcontainer --write # добавить их в .devcontainer/devcontai
154
160
  Демон создаёт сокет моста при старте: на хосте выполните `revdeck daemon restart`, затем пересоберите
155
161
  контейнер. В контейнере revdeck никогда не запускает свой демон, поэтому `gh`/`glab` там не
156
162
  вызываются; если сокет хоста недоступен, команда падает с понятной ошибкой `DEVCONTAINER`.
157
- `revdeck doctor` знает об этом режиме. Для UI из контейнера запустите демон на хосте с
158
- `revdeck daemon start --host 0.0.0.0`.
163
+ `revdeck doctor` знает об этом режиме.
164
+
165
+ Если Unix-сокет не монтируется (например, Docker Desktop на macOS), запустите демон на хосте с
166
+ `revdeck daemon start --host 0.0.0.0`. Клиент в контейнере прочитает `daemon.json` из смонтированного
167
+ state и переключится на HTTP с тем же токеном сессии; `revdeck devcontainer --write` добавляет нужные
168
+ `REVDECK_*` в `.mcp.json` / `.cursor/mcp.json`. Привязка к `0.0.0.0` открывает HTTP-порт в сеть —
169
+ используйте это только в доверенной сети.
159
170
 
160
171
  ## MCP
161
172
 
@@ -266,8 +277,8 @@ npm run build # dist/cli.js, dist/daemon.js, dist/mcp.js, dist/ui
266
277
  - Проверки проекта агент только планирует; запуск — `revdeck checks --run --yes`.
267
278
  - UI открывает ревью через диалог **Открыть ревью**; нужен корень рабочей копии, чтобы демон
268
279
  прочитал `.revdeck.yml`.
269
- - Резолв тредов есть в карточке треда; реакции доступны на комментариях тредов в UI и через
270
- `revdeck react`.
280
+ - Резолв тредов есть в карточке треда; реакции доступны на комментариях тредов и на описании MR/PR.
281
+ Свои комментарии платформы можно редактировать и удалять из карточки треда.
271
282
  - У GitHub нет публичного API загрузки вложений: кнопка «Прикрепить» там отключена; загрузка работает
272
283
  в GitLab.
273
284
  - Поддержаны Linux и macOS для автозапуска; Windows — запуск вручную.
package/dist/cli.js CHANGED
@@ -168,7 +168,7 @@ var VERSION;
168
168
  var init_version = __esm({
169
169
  "src/version.ts"() {
170
170
  "use strict";
171
- VERSION = "0.3.3";
171
+ VERSION = "0.4.0";
172
172
  }
173
173
  });
174
174
 
@@ -217,6 +217,12 @@ function devcontainerHint() {
217
217
  "gh/glab \u0434\u043E\u043B\u0436\u043D\u044B \u043E\u0441\u0442\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u0445\u043E\u0441\u0442\u0435: \u0432\u043D\u0443\u0442\u0440\u0438 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0430 \u0438\u0445 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u043D\u0435 \u043D\u0443\u0436\u043D\u043E"
218
218
  ].join("; ");
219
219
  }
220
+ async function devcontainerHttpClient() {
221
+ const info = await daemonInfo();
222
+ if (!info?.port || !info.token) return null;
223
+ const host = process.env.REVDECK_UI_HOST ?? "host.docker.internal";
224
+ return new HttpClient(`http://${host}:${info.port}`, info.token);
225
+ }
220
226
  async function ensureDaemon(options = {}) {
221
227
  const url = process.env.REVDECK_URL;
222
228
  if (url) {
@@ -228,6 +234,19 @@ async function ensureDaemon(options = {}) {
228
234
  return { client: await connectSocket(), started: false };
229
235
  } catch (error) {
230
236
  if (isDevContainer()) {
237
+ const http = await devcontainerHttpClient();
238
+ if (http) {
239
+ try {
240
+ await http.request("ping");
241
+ return { client: http, started: false };
242
+ } catch (httpError) {
243
+ throw new RpcError(
244
+ `devcontainer HTTP: ${httpError.message}`,
245
+ "DEVCONTAINER",
246
+ "\u043D\u0430 \u0445\u043E\u0441\u0442\u0435: revdeck daemon start --host 0.0.0.0; \u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 REVDECK_UI_HOST \u0438 mounts"
247
+ );
248
+ }
249
+ }
231
250
  throw new RpcError(`devcontainer: ${devcontainerHint()}`, "DEVCONTAINER", "revdeck devcontainer --write \u0438 \u043F\u0435\u0440\u0435\u0441\u043E\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440");
232
251
  }
233
252
  if (options.autoStart === false) throw error;
@@ -279,7 +298,7 @@ function uiBaseUrl(info) {
279
298
  }
280
299
  async function daemonBinaries() {
281
300
  try {
282
- const client2 = await connectSocket(void 0, 800);
301
+ const { client: client2 } = await ensureDaemon({ autoStart: false });
283
302
  const ping = await client2.request("ping");
284
303
  client2.close();
285
304
  return ping.binaries ?? null;
@@ -289,7 +308,7 @@ async function daemonBinaries() {
289
308
  }
290
309
  async function isDaemonRunning() {
291
310
  try {
292
- const client2 = await connectSocket(void 0, 400);
311
+ const { client: client2 } = await ensureDaemon({ autoStart: false });
293
312
  await client2.request("ping");
294
313
  client2.close();
295
314
  return true;
@@ -528,6 +547,7 @@ function renderContext(review, rules2, options = {}) {
528
547
  for (const finding of review.findings) {
529
548
  push(`- \`${finding.id}\` \xB7 ${finding.level} \xB7 ${finding.file}:${finding.line ?? "-"} \xB7 ${finding.status} \xB7 ${truncate(finding.title, 300)}`);
530
549
  if (finding.body) push(` ${truncate(finding.body, 500)}`);
550
+ if (finding.agentNote) push(` \u2192 ${t("\u0430\u0433\u0435\u043D\u0442\u0443", "to agent")}: ${truncate(finding.agentNote, 500)}`);
531
551
  }
532
552
  push("");
533
553
  if (review.notes.length) {
@@ -893,7 +913,8 @@ Next: revdeck_context(review="${result.review.id}").`, { reviewId: result.review
893
913
  endLine: z2.number().int().positive().nullable().optional(),
894
914
  title: z2.string().min(1),
895
915
  body: z2.string(),
896
- comment: z2.string().optional().describe("Ready-to-post comment text; defaults to body")
916
+ comment: z2.string().optional().describe("Ready-to-post comment text; defaults to body"),
917
+ agentNote: z2.string().optional().describe("Private note for the agent; never published")
897
918
  })
898
919
  ).describe("The complete findings list, not only new ones")
899
920
  }
@@ -1885,7 +1906,9 @@ async function mergeMcpJson(file, root, mcp) {
1885
1906
  }
1886
1907
  }
1887
1908
  const servers = data.mcpServers ?? {};
1888
- servers["revdeck"] = mcp;
1909
+ const previous = servers["revdeck"];
1910
+ const previousEnv = previous && typeof previous === "object" && "env" in previous && previous.env && typeof previous.env === "object" ? previous.env : {};
1911
+ servers["revdeck"] = { ...mcp, env: { ...previousEnv, ...mcp.env ?? {} } };
1889
1912
  data.mcpServers = servers;
1890
1913
  await writeFile(file, `${JSON.stringify(data, null, 2)}
1891
1914
  `);
@@ -2195,13 +2218,32 @@ async function runDevcontainer(rootInput, options) {
2195
2218
  }
2196
2219
  await writeFile2(file, output);
2197
2220
  writers.out(`\u2714 ${path7.relative(root, file)}`);
2221
+ await mergeMcpEnv(root, patch.containerEnv);
2198
2222
  if (existed) writers.out(tr(" \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B.", " comments were preserved."));
2199
2223
  writers.out("");
2200
2224
  writers.out(tr("\u0414\u0430\u043B\u044C\u0448\u0435:", "Next:"));
2201
2225
  writers.out(tr(" 1. \u041D\u0430 \u0445\u043E\u0441\u0442\u0435: revdeck daemon restart \u2014 \u043E\u043D \u0441\u043E\u0437\u0434\u0430\u0441\u0442 \u0441\u043E\u043A\u0435\u0442 \u043C\u043E\u0441\u0442\u0430.", " 1. On the host: revdeck daemon restart \u2014 it creates the bridge socket."));
2202
2226
  writers.out(tr(" 2. \u041F\u0435\u0440\u0435\u0441\u043E\u0431\u0435\u0440\u0438\u0442\u0435/\u043F\u0435\u0440\u0435\u043E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 devcontainer.", " 2. Rebuild/reopen the devcontainer."));
2203
2227
  writers.out(tr(" 3. \u0412 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0435: revdeck doctor \u2014 \u043E\u043D \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043A\u0430\u0442\u044C glab/gh \u0432\u043D\u0443\u0442\u0440\u0438.", " 3. In the container: revdeck doctor \u2014 it will not look for glab/gh inside."));
2204
- writers.out(tr(" \u0414\u043B\u044F UI \u0438\u0437 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0430 \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0434\u0435\u043C\u043E\u043D \u043D\u0430 \u0445\u043E\u0441\u0442\u0435 \u0441 --host 0.0.0.0.", " For the UI from the container, start the daemon on the host with --host 0.0.0.0."));
2228
+ writers.out(tr(" \u0414\u043B\u044F UI/MCP \u0438\u0437 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0430 (\u0438\u043B\u0438 \u0435\u0441\u043B\u0438 \u0441\u043E\u043A\u0435\u0442 \u043D\u0435 \u043C\u043E\u043D\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044F) \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0434\u0435\u043C\u043E\u043D \u043D\u0430 \u0445\u043E\u0441\u0442\u0435 \u0441 --host 0.0.0.0.", " For the UI/MCP from the container (or when the socket cannot be mounted), start the daemon on the host with --host 0.0.0.0."));
2229
+ }
2230
+ async function mergeMcpEnv(root, env) {
2231
+ for (const relative of [".mcp.json", ".cursor/mcp.json"]) {
2232
+ const file = path7.join(root, relative);
2233
+ if (!existsSync6(file)) continue;
2234
+ try {
2235
+ const data = JSON.parse(await readFile4(file, "utf8"));
2236
+ const servers = isRecord(data.mcpServers) ? data.mcpServers : null;
2237
+ const server2 = servers && isRecord(servers.revdeck) ? servers.revdeck : null;
2238
+ if (!server2) continue;
2239
+ server2.env = { ...isRecord(server2.env) ? server2.env : {}, ...env };
2240
+ await writeFile2(file, `${JSON.stringify(data, null, 2)}
2241
+ `);
2242
+ writers.out(`\u2714 MCP env: ${relative}`);
2243
+ } catch (error) {
2244
+ writers.err(`! ${relative}: ${tr("\u043D\u0435 JSON \u2014 \u043D\u0435 \u0442\u0440\u043E\u0433\u0430\u044E", "not JSON \u2014 leaving it untouched")} (${error.message})`);
2245
+ }
2246
+ }
2205
2247
  }
2206
2248
 
2207
2249
  // src/cli/eject.ts